import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//技术报告录入
//技术报告录入 - 主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPTech/getListByPage`,  params );
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPTech/saveOne`,  params );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPTech/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPTech/updateEnableByIds`,  null ,{params : data} );
//Excel导出
// export const excelExport = params => axios.get(`${SERVER.CLAIMFAC}/rPReturnWhMp/getListForExport`, params);
// export const excelExport = params => axios.post(`${SERVER.CLAIMFAC}/rPReturnWhMp/getListForExport`,  params );

// 选择旧件列表
export const getStockListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPTech/getStockListByPage`,  params );

//通过ID查
export const selectById = params => axios.get(`${SERVER.CLAIMFAC}/rPTech/selectById/${params.id}`);

export const excelExport = params => {
  return axios({
    url:`${SERVER.CLAIMFAC}/rPReturn/getListForExport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};

//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPTech/updateByPtId`,  params );

//技术报告评价导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPTech/getListForExportEvaluate`, params, {
  responseType: 'blob'
});
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

// 查询是否车辆是否首发
export const checkFirst = params => axios.get(`${SERVER.CLAIMFAC}/rPTechFault/checkFirst`, { params });




